import { useUserStoreContext } from '../../stores/modules/user'
import { AxiosRequestConfig } from 'axios'

export default function (config: AxiosRequestConfig) {
    debugger
    const useStore = useUserStoreContext()
    if (config) {
        if (!config.headers) {
            config.headers = {}
        }
        if (!config.headers['Auth']) {
            config.headers['Auth'] = useStore.token
        }
    }
    return config
}